package cn.cangli.controller;

import cn.cangli.pojo.DeptOption;
import cn.cangli.pojo.GenderOption;
import cn.cangli.pojo.JobOption;
import cn.cangli.pojo.Result;
import cn.cangli.service.EmpService;
import cn.cangli.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/report")
@RestController
public class ReportController {

    @Autowired
    private EmpService empService;
    @GetMapping("/empJobData")
    public Result getEmpJobData() {
        JobOption empJobData = empService.getEmpJobData();
        return Result.success(empJobData);
    }

    @GetMapping("/empDeptData")
    public Result getEmpDeptData() {
        DeptOption empDeptData = empService.getEmpDeptData();
        return Result.success(empDeptData);
    }

    @GetMapping("/empGenderData")
    public Result getEmpGenderData() {
//        empService.getByGender();
        GenderOption genderOption = empService.countGenderData();
        return Result.success(genderOption);
    }
}
